#pragma once

#include <ddm/Config.h>
#include <ddm/if/gen-cpp2/DDM_types.h>
#include <openr/common/OpenrClient.h>
#include <openr/common/OpenrEventBase.h>
#include <openr/if/gen-cpp2/OpenrCtrlCppAsyncClient.h>
#include <openr/messaging/ReplicateQueue.h>

namespace ddm {
class OpenrAgent : public openr::OpenrEventBase {
 public:
  OpenrAgent(std::string nodeName, std::shared_ptr<ddm::Config> config,
             openr::messaging::ReplicateQueue<ddm::thrift::Requirement>&
                 requirementsQueue);
  void startSubscribe();
  void subscribeNeighbor();
  void stop() override;

 private:
  std::string nodeName_;
  std::shared_ptr<ddm::Config> config_;
  std::unique_ptr<openr::thrift::OpenrCtrlCppAsyncClient> openrClient_;
  openr::messaging::ReplicateQueue<ddm::thrift::Requirement>&
      requirementsQueue_;
  // apache::thrift::ClientBufferedStream<openr::thrift::Publication>::Subscription
  // subscription_{nullptr};
};
}  // namespace ddm